//判断数组是否相等
export const isArrayEqual = (arrayA, arrayB) => {
    return JSON.stringify(arrayA) === JSON.stringify(arrayB);
}

export const isObjectEqual = (oA, oB) => {
    if (!oA || !oB) return false;
    let isEqual = true;
    Object.keys(oA).forEach((k) => {
        if (oA[k] !== oB[k]) {
            isEqual = false;
        }
    })
    Object.keys(oB).forEach((k) => {
        if (oA[k] !== oB[k]) {
            isEqual = false;
        }
    })
    return isEqual;
}
//获得function的名称
export function getFunctionName (fun){
    return fun.name;
}
//删除object相同的值

export const deleteSameValueInObject = (src,default_) => {
    Object.keys(src).forEach((k) => {//删除空值
        if (!k || src[k] === "" || src[k] === undefined) {
            delete src[k];
            return false;
        }
        if (default_ && src[k] === default_[k]) {
            delete src[k];
        }

    })

    return src;
}